#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
This module is a public domain software, and you may redistribute it and/or modify
it under the same terms as LGPL2.1 license itself, so long as this copyright message
and disclaimer are retained in their original form.

IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF
THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.

THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE.  THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS,
AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

© 2011 Sunny Lin. All Rights Reserved.
Created on 2011/11/2
'''
__author__ = "Sunny Lin"
__email__ = "013.lin@gmail.com"
__version__ = "0.13"

class MonkeyError(Exception):
  ''' The base class of all Monkey test error. '''
  def __init__(self, msg):
    #self.msg = msg
    Exception.__init__(self, msg)   
      
  #def __str__(self):         
  #  return repr(self.msg)     

class MonkeyAreaUndefinedError(MonkeyError):
  '''Exception raised for error that no named area is defined in ini file. 

    Attributes:
        area_name -- the area name to look for
  '''
  def __init__(self, area_name):
    msg = ("Not found area name, %s. That should be defined in ini file." %area_name)
    MonkeyError.__init__(self, msg)   

class MonkeyImageNotFoundError(MonkeyError):
  '''Exception raised for error that the image file is not found in resources path. 

    Attributes:
        image_file -- the image file name to load
  '''
  def __init__(self, image_file):
    msg = ("Not found file : %s." %image_file)
    MonkeyError.__init__(self, msg)     

class MonkeyUnsupportedParameterTypeError(MonkeyError):
  '''Exception raised for error that pass an unsupported type parameter 

    Attributes:
        type_name -- parameter type name
  '''
  def __init__(self, type_name):
    msg = ("Unsupported parameter type: %s." %type_name)  
    MonkeyError.__init__(self, msg) 
    
class MonkeyFailure(Exception):
  def __init__(self, fail_pic, fail_desc):
    self.fail_pic=fail_pic
    #self.fail_desc=fail_desc
    Exception.__init__(self, fail_desc) 

